package cn.com.lyj6851.common.web.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * @ JSONField(name="id")修改和json字符串的字段映射【name】
 * @ JSONField(serialize=false) 格式化数据【format】
 * @ JSONField(format=/"yyyy-MM-dd HH:mm:ss") 过滤掉不需要序列化的字段【serialize】
 * @ param <T>
 */

@Data
@ApiModel("分页")
public class Paging<T> implements Serializable {
    private static final long serialVersionUID = -1683800405530086022L;

    @ApiModelProperty("总行数")
    @JSONField(name = "total")
    @JsonProperty("total")
    private long total = 0;

    @ApiModelProperty("数据列表")
    @JSONField(name = "records")
    @JsonProperty("records")
    private List<T> records = Collections.emptyList();

}
